let initdata = {
    name: "zangahn",
    arr: [],
    age: "20"
}
let hotReducer = (state = initdata, {
    type,
    payload
}) => { // 把以前得action结构出来
    switch (type) {
        case 'setname':
            return {
                ...state,
                name: payload
            }
            
        case 'getlist':
            return {
                ...state,
                arr: payload
            }
        case 'setage':
            return {
                ...state,
                age: payload
            }
        default:
            return {
                ...state
            }

    }
}
export default hotReducer